#include "Race.h"
using namespace std;

DebugLevelType Race::elementaire  = BLANK;
DebugLevelType Race::fonction     = BLANK;

Race::Race(const string& type)
{
  Type = type;
}

Race::Race(const Race& race)
{
  unsigned int taille(race.capacites.size());
  for (unsigned int i(0); i<taille; i++)
    capacites.push_back(race.capacites[i]);
  Type = race.Type;  
}

Race::~Race()
{}

string Race::get_Type() const
{
  return Type;
}

unsigned int Race::get_taille() const
{
  return capacites.size();
}

unsigned int Race::get_capa(const unsigned int& i) const
{
  if (i < capacites.size())
    return capacites[i];
  else
    {
      dout(ERR) << "Compétence inexistante, dépassement de portée" << endl;
      return 65535;
    }
}

void Race::setLevel(const DebugLevelType& level, const unsigned int& n)
{
  switch(n)
    {
    case 1:
      elementaire = level;
      break;
    case 2:
      fonction = level;
      break;
    default:
      dout(WARN) << "Variable inconnue, dans Race::setLevel " << n << endl;
    }
}

/*
  void Race::appliquer_ajustements(unsigned int tab[6])
  {
  switch (choix)
  {
  case Nain:
  tab[2]++;
  tab[5]--;
  break;
  case Elfe:
  tab[1]++;
  tab[2]--;
  break;
  case Gnome:
  tab[3]++;
  tab[4]--;
  break;
  case Demi-orque:
  tab[0]++;
  tab[2]++;
  tab[5]-=2;
  break;
  case Demi-ogre:
  tab[0]++;
  tab[2]++;
  tab[3]--;
  tab[5]--;
  break;
  case Hobbit:
  tab[0]--;
  tab[1]++;
  break;
  }
  }
*/
